<template>
    <u-navbar v-bind="Object.assign(defaultBind, $attrs, $props)">
        <template #center>
            <view class="text-[32rpx]" :style="{ color }">
                {{ props.title }}
            </view>
        </template>
        <template #right>
            <slot name="right"></slot>
        </template>
    </u-navbar>
</template>
<script lang="ts" setup>
import { computed } from 'vue';

let props = withDefaults(defineProps<{
    safeAreaInsetTop?: boolean,
    placeholder?: boolean,
    color?: string,
    title?: string
}>(), {
    safeAreaInsetTop: true,
    placeholder: true
});
let defaultBind = computed(() => {
    let data: { [key: string]: any } = { autoBack: true }
    if (props.color) {
        data.leftIconColor = props.color
    }
    return data
})


</script>